package com.ruoyi.system.domain;

import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 订单项对象 shop_order_item
 * 
 * @author ruoyi
 * @date 2025-10-20
 */
public class ShopOrderItem extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 订单项唯一ID */
    private Long itemId;

    /** 关联订单主表ID */
    @Excel(name = "关联订单主表ID")
    private String orderId;

    /** 关联商品ID */
    @Excel(name = "关联商品ID")
    private Long productId;

    /** 商品名称（冗余，避免商品改名） */
    @Excel(name = "商品名称", readConverterExp = "冗=余，避免商品改名")
    private String productName;

    /** 商品图片 */
    @Excel(name = "商品图片")
    private String productImg;

    /** 商品规格（如"中杯/少糖"） */
    @Excel(name = "商品规格", readConverterExp = "如='中杯/少糖'")
    private String specDesc;

    /** 单品单价（下单时价格） */
    @Excel(name = "单品单价", readConverterExp = "下=单时价格")
    private BigDecimal singlePrice;

    /** 购买数量 */
    @Excel(name = "购买数量")
    private Long buyNum;

    /** 单品总价（单价×数量） */
    @Excel(name = "单品总价", readConverterExp = "单=价×数量")
    private BigDecimal totalPrice;

    public void setItemId(Long itemId) 
    {
        this.itemId = itemId;
    }

    public Long getItemId() 
    {
        return itemId;
    }

    public void setOrderId(String orderId) 
    {
        this.orderId = orderId;
    }

    public String getOrderId() 
    {
        return orderId;
    }

    public void setProductId(Long productId) 
    {
        this.productId = productId;
    }

    public Long getProductId() 
    {
        return productId;
    }

    public void setProductName(String productName) 
    {
        this.productName = productName;
    }

    public String getProductName() 
    {
        return productName;
    }

    public void setProductImg(String productImg) 
    {
        this.productImg = productImg;
    }

    public String getProductImg() 
    {
        return productImg;
    }

    public void setSpecDesc(String specDesc) 
    {
        this.specDesc = specDesc;
    }

    public String getSpecDesc() 
    {
        return specDesc;
    }

    public void setSinglePrice(BigDecimal singlePrice) 
    {
        this.singlePrice = singlePrice;
    }

    public BigDecimal getSinglePrice() 
    {
        return singlePrice;
    }

    public void setBuyNum(Long buyNum) 
    {
        this.buyNum = buyNum;
    }

    public Long getBuyNum() 
    {
        return buyNum;
    }

    public void setTotalPrice(BigDecimal totalPrice) 
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getTotalPrice() 
    {
        return totalPrice;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("itemId", getItemId())
            .append("orderId", getOrderId())
            .append("productId", getProductId())
            .append("productName", getProductName())
            .append("productImg", getProductImg())
            .append("specDesc", getSpecDesc())
            .append("singlePrice", getSinglePrice())
            .append("buyNum", getBuyNum())
            .append("totalPrice", getTotalPrice())
            .toString();
    }
}
